<%@ page import="java.util.List"%>
<%@ page import="com.pension.model.dto.Member"%>
<%@ page import="java.util.ArrayList"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>

<!DOCTYPE html>

<html>
<head>
	<meta charset="utf-8" />
    <title></title>
    <link rel="Stylesheet" href="/pension/styles/default.css" />
    <script type="text/javascript">
    function checkall(frm)
    {
       var i=0;
       if(frm.checkItem.length){
          ;
       }else{
          if(frm.allCheck.checked){
             frm.checkItem.checked=true;
          }else{
             frm.checkItem.checked=false;
          }
       }
     
       if(frm.checkItem.length > 1){
          for(i=0; i<frm.checkItem.length; i++){
             if(frm.allCheck.checked){
                frm.checkItem[i].checked=true;
             }else{
                frm.checkItem[i].checked=false;
          }
        }
      }
    }
    </script>
    
    
</head>
<body>

    <div id="pageContainer">
        <% pageContext.include("/WEB-INF/views/include/header.jsp"); %>
        <div id="content">
        	<br /><br />
        	<div style='text-align:center'>
        		[&nbsp;<a href="list.action" style="text-decoration: none; color: #ffffff; font-weight: bold;">목록으로</a>&nbsp;]
        	</div>
        	<br /><br />   
        	<form name="myForm" action="deletemember.action" method="post"> 
        	<% List<Member> members = (List<Member>)request.getAttribute("members"); %>    	
        	<table border="1" align="center" width="700px" style='text-align:center' >
        	
        		<tr style="height:30px; background-color:#4B4B4B; font-weight: bold;">
        			<td >
        			<input type="checkbox" name="allCheck" value="all" OnClick="checkall(this.form)"/>
        			
        			</td>
        			<td>아이디</td>
        			<td>이메일</td>
        			<td>연락처</td>
        			<td>사용자구분</td>
        			<td>등록일자</td>
        		</tr>
				<% Member member2 = (Member)session.getAttribute("loginuser"); %>
				<% for (Member member : members) {
					Object user = new Object();
					user = member.getMemberId();
				%>
        		<tr style="height:30px; background-color:#808080;">
        			<td>
        			<%-- <% if (member.getMemberId().equals(session.getAttribute("loginuser"))) { --%>
        			<% if (member2.getMemberId().equals(member.getMemberId())) {
        				/* out.print(session.getAttribute("loginuser")); */
        				out.print(member2.getMemberId());
        			%>
        			<% } else { %>	
        				<input type="checkbox" name="checkItem" value="<%= member.getMemberId() %>"/>        	
        			<% } %>
        			</td>
        			<td><%= member.getMemberId() %></td>
        			<td><%= member.getEmail() %></td>
        			<td><%= member.getPhone1() %></td>
        			<td><%= member.getUserType() %></td>
        			<td><%= member.getRegDate() %></td>
        		</tr>
        		<% } %>
        		

        	</table>
        	</form>
        	<br /><br /><br /><br />
        	<div style='text-align:center'>
        		[&nbsp;<a href="javascript:document.forms[0].submit()"  style="text-decoration: none; color: #ffffff; font-weight: bold;">삭제</a>&nbsp;]
        	</div>
        </div>
    </div>
    
</body>
</html>









